<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
	<title>订单信息-豆瓣集市</title>
	<style type="text/css">
		.center{
			width:957px;
			height: 635px;
			margin:0 auto;
			margin-top:3px;
			float:center;
		}
		.top{
			height: 25px;
			width:955;
			float:left;
		}
		.top img{
			line-height:25px;
		}
		.xq{
			margin-top:15px;
			width:100%;
			height: 500px;
			float: left;
			font-size:14px;
			color:gray;
		}
		.ts{
			margin-top:15px;
			width:100%;
			height: 150px;
			float:left;
			font-size:25px;
			border-top:2px solid gray;
		}
		.ts img{
			margin-top:30px;
			margin-left:100px;
		}
		#b{
			background: #FFFFCD;
			width:100%;
			/*color:green;*/
			height:36px;
			line-height:36px;
		}
		#a{
			height:36px;
			line-height:36px;
		}
	</style>

  </head>
<body>
<!--导入插件-->
<div class="center">
	<div class="top">
		<img src="/Images/lg.png" alt="">
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<img src="/Images/dd2.png" alt="">
	</div>
	<div class="ts">
		<span style="color:red;"><img src="/Images/dh.png" alt="">&nbsp&nbsp订单提交成功</span><br>
		 <span style="color:gray; float:left;margin-left:70px;font-size:18px;">我们将会保留您的订单一周,过期将会删除.请及时查看您的物流信息.</span>
	</div>	
	<div class="xq">
		&nbsp<span style="color:green;">物流信息</span><br><br>

		<div id="b">&nbsp&nbsp&nbsp&nbsp &nbsp 用户名 : {{$um->username}}<br></div>

		<div id="a">&nbsp&nbsp&nbsp&nbsp&nbsp购买商品 : {{$goods->name}}<br></div>

	@foreach($res as $k=>$v)
		<div id="b">&nbsp&nbsp&nbsp&nbsp&nbsp收件人名 : {{$v->gname}}<br></div>
		<div id="a">&nbsp&nbsp&nbsp&nbsp&nbsp收件人名 : {{$v->phone}}<br></div>
		<div id="b">&nbsp&nbsp&nbsp&nbsp&nbsp收货地址 : {{$v->address}}<br></div>
		<div id="a">&nbsp&nbsp&nbsp&nbsp&nbsp下单时间 : {{$v->itime}}<br></div>
		<div id="b">&nbsp&nbsp&nbsp&nbsp&nbsp邮递方式 : {{$v->send}}<br></div>
		<div id="a">&nbsp&nbsp&nbsp&nbsp&nbsp付款方式 : {{$v->payment}}<br></div>
	@endforeach

	@foreach($data as $k=>$v)
		<div id="b">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp订单号 : {{$v->oid}}<br></div>
		<div id="b">&nbsp&nbsp&nbsp&nbsp&nbsp物品单价 : ￥{{$v->price}}<br></div>
		<div id="a">&nbsp&nbsp&nbsp&nbsp&nbsp购买数量 : {{$v->inum}}<br></div>
		<div id="b">&nbsp&nbsp&nbsp&nbsp&nbsp总付金额 : ￥{{$v->figure}}(含邮费)<br></div>
	@endforeach
	</div>
<form role="form" id="forms" action="{{url('/home/dingdan/update')}}" method="post" enctype="multipart/form-data">
		<input type="hidden" name="figure" value="{{ $v->figure }}">
		<input type="hidden" name="gds" value="{{$goods->name}}">
		<input type="hidden" name="oid" value="{{$v->oid}}">
	<div class="tp" style="color:green; float:left;">
	留言版:
		<input type="text" name="ly">
	</div>
<button type="submint" style="margin-right:50px; background-color:gerrn; height:40px;color:green;float:right; border:1px solid red;">提交意见</button>
	{{csrf_field()}}
</form>
	<div style="height:150px;">
		
	</div>
</div>






<!-- 地址的js -->
<script type="text/javascript">
    $(document).ready(function() {
        showLocation();
        $('#addresses .attr').each(function(){
            var str = $(this).attr('attr');
            var info = getInfo(str);
            $(this).html(info);
        });

        //定义获取城市信息方法
        function getInfo(str){
            //console.log(str);
            //拆分字符串
            var arr = str.split(',');
            // console.log(arr);    
            var ls  = new Location;
            var l = ls.items;
            // console.log(l['0,1,2']['5']);
            var sheng = l['0'][arr[0]];
            var shi = l['0,'+arr[0]][arr[1]];
            var xian = l['0,'+arr[0]+','+arr[1]][arr[2]];
            // return sheng+shi+xian;
            return [sheng,shi,xian];
        }

        $('#forms').submit(function(){
            var sheng = $('select[name=sheng]').val();
            var shi = $('select[name=shi]').val();
            var xian = $('select[name=xian]').val();
            var s = sheng+','+shi+','+xian;
            var v = getInfo(s);
            // console.log(v);
            for (var i = 0; i < v.length; i++) {
                var inpu = $('<input type="hidden" name="'+i+'" value="'+v[i]+'" />');
                $('#forms').append(inpu);
            };
            // return false;
        }) 
    });
</script>
<!-- 地址的js结束 -->

<!-- -+的js -->
<script type="text/javascript">
  // alert($);
  $('.plus').click(function(){
    //获取当前数量
    var num = parseInt($('input[title=Qty]').val());
    num = num+1;
    //修改属性
    $('input[title=Qty]').val(num);
  })


  $('.minus').click(function(){
    //获取当前数量
    var num = parseInt($('input[title=Qty]').val());
    num = num-1;
    if(num == 0)return;
    //修改属性
    $('input[title=Qty]').val(num);
  })

    // 单机事件 加入购物车
    $('.addCart').click(function(){
    // 
      // 获取参数
      var id = $('.quantity').find('input[name=id]').val();
      var num = $('.quantity').find('input[name=num]').val();
      console.log(id,num);
      $.ajaxSetup({
        headers:{
          'X-CSRF-TOEN':$('meta[name="csrf-token"]').attr('content')
        }
      });
      // 发送ajax
      $.post('/home/car/che',{id:id,num:num},function(data){
        console.log(data);
        if(data == 1){
            alert('加入购物车成功');
        }else{
          alert('加入购物车失败');
        }
      })
    })
</script>
<!-- -+的js结束 -->

</body>
</html>